-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotfix: Fix Routing Form Saving related issue #4954
Hotfix: Fix Routing Form Saving related issue #4954
Conversation
… middleware and that too after build
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…-compiled-next.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self reviewed
@@ -262,3 +259,20 @@ export default function SingleForm({ | |||
</Form> | |||
); | |||
} | |||
|
|||
export default function SingleFormWrapper({ form: _form, ...props }: SingleFormComponentProps) { | |||
const { data: form, isLoading } = trpc.useQuery(["viewer.app_routing_forms.formQuery", { id: _form.id }], { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we are using tRPC now, it is important that useForm is called in a child component which is rendered only when form
is available. THis is to avoid initialization of useForm with defaultValues:undefined
@@ -175,35 +175,32 @@ const Actions = ({ | |||
); | |||
}; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix Eslint warning in a follow up PR>
… middleware and that too after build (#4954)
Fixes #4950
The issue seems to occur with a combination of following:
Solution, is to use tRPC fetched form for rendering, which would be invalidated on every save and works correctly.